package student.aistar.mapper;

import org.apache.ibatis.annotations.Select;
import student.aistar.model.entity.Navclass;
import student.aistar.model.entity.Navpro;
import student.aistar.model.entity.Product;

import java.util.List;

/**
 * 本类用来演示:
 *
 * @author: qinFeng
 * @date: 2021/9/27 14:49
 */
public interface IndexMapper {
    /**
     * 查询顶部导航栏名
     * @return
     */
    @Select("select * from navclass")
    List<Navclass> selectNavClass();


    /**
     * 查询顶部导航栏名称的不同产品
     * @param navId
     * @return
     */
    @Select("select * from navpro where nav_id = #{navId}")
    List<Navpro> selectNavProByNavId(Integer navId);

    /**
     * 首页的数据, 每个分类只需要查八条
     * @param categoryId
     * @return
     */
    @Select("select * from product where category_id = #{categoryId} limit 8")
    List<Product> productLIstLimitEight(Integer categoryId);
}
